package com.ctshk.rpc.system.service.impl;


import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ctshk.rpc.system.entity.MainDataTicketScenic;
import com.ctshk.rpc.system.mapper.MainDataTicketScenicMapper;
import com.ctshk.rpc.system.service.IMainDataTicketScenicService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Set;

/**
 * <p>
 * 主数据门票中心规格级别 服务实现类
 * </p>
 *
 * @author 张志朋
 * @since 2021-02-23
 */
@DubboService
public class MainDataTicketScenicServiceImpl extends ServiceImpl<MainDataTicketScenicMapper, MainDataTicketScenic> implements IMainDataTicketScenicService {

    @Autowired
    private MainDataTicketScenicMapper mainDataTicketScenicMapper;

    /**
     * 根据规格id查询规格等级
     *
     * @param map 入参规格id
     * @return
     */
    @Override
    public Map<Long, String> querySpecLevel(Map<Long, String> map) {
            Map<Long, String> specLevelMap = new HashMap<>();
            for (Long id : map.keySet()) {
                MainDataTicketScenic dto = baseMapper.selectById(id);
                if (!Objects.isNull(dto)) {
                    specLevelMap.put(id, dto.getSpecLevel());
                }
            return specLevelMap;
        }
        return null;
    }
}











